<?php 
	include "../ini.php";
	include "../../libraries/xl_hoa_don.php";
	include "../../libraries/pager.php";	
	$dt_xl_hoa_don	= new xl_hoa_don;
	$dt_pager = new pager;
?>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Page-Enter" content="revealTrans(Duration=1.0,Transition=3)">
<?php include"../includes/js_css.php"?>
</head>
<body>
<div id="body-wrapper"> <!-- Wrapper for the radial gradient background -->
  
  <?php include"../widgets/sidebar.php"?>
  <!-- End #sidebar -->
  
  <div id="main-content"> <!-- Main Content Section with everything -->
    
    <?php include"../widgets/noscript.php"?>
    <div class="clear"></div>
    <!-- End .clear -->
    
    <div class="content-box"><!-- Start Content Box -->
      
      <div class="content-box-header">
        <h3>Danh sách đơn hàng</h3>
        <div class="clear"></div>
      </div>
      <!-- End .content-box-header -->
      
      <div class="content-box-content">
        <div class="tab-content default-tab" id="tab1"> <!-- This is the target div. id must match the href of this div's tab -->
          <div><?php message()?></div>  
          <form name="f2" id="f2" method="post" action="deletes.php">        
          <table>
            <thead>
              <tr>
                <th>Mã đơn hàng</th>
                <th><div style="text-align:center;">Họ tên</div></th>
                <th><div style="text-align:center;">Điện thoại</div></th>
                <th><div style="text-align:center;">Địa chỉ</div></th>
                <th> <div style="text-align:center;">Ngày tạo </div></th>
                <th> <div style="text-align:center;">Tổng tiền </div></th>
              </tr>
            </thead>
            <tfoot>
              <tr>
                <td colspan="6">
                  <div class="pagination"> 
					<?php 
						$tong_so_dong = $dt_xl_hoa_don->so_luong();
						$tong_so_trang = $dt_pager->findPages($tong_so_dong,BAIVIET_LIMIT);
                    	echo $dt_pager->pageList($_GET['page'],$tong_so_trang);
                    ?>
                   </div></td>
              </tr>
            </tfoot>
            <tbody>
            <?php 
				$vitri = $dt_pager->findStart(BAIVIET_LIMIT);
				$ds_hoa_don = $dt_xl_hoa_don->danh_sach($vitri,BAIVIET_LIMIT);
				foreach($ds_hoa_don as $hoa_don){
			?>
              <tr class="alt-row">
                <td><?php echo $hoa_don["ma"]?></td>
                <td><a title="title" href="detail.php?id=<?php echo $hoa_don["ma"]?>"> <?php echo $hoa_don["ho_ten"]?></a></td>
                <td  style="text-align:center"><?php echo $hoa_don["dien_thoai"]?></td>
                <td  style="text-align:center"><?php echo $hoa_don['dia_chi']?></td>
                <td class="ngay_tao" style="text-align:center"><?php echo $hoa_don["ngay_tao"]?></td>
                <td style="text-align:center !important">                
                  <?php echo number_format( $hoa_don["tong_tien"])?></td>
              </tr>
             <?php }?>
            </tbody>
          </table>
          </form>
        </div>
        <!-- End #tab1 --> 
        
      </div>
      <!-- End .content-box-content --> 
      
    </div>
    <!-- End .content-box -->
    
    <div class="clear"></div>
    <?php include"../widgets/footer.php"?>
  </div>
  <!-- End #main-content --> 
  
</div>
</body>
</html>
